package io.zhou.controller;

import io.zhou.common.entity.PmsCategory;
import io.zhou.common.entity.Reuslt;
import io.zhou.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/user")
@RestController
@CrossOrigin
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("/tree")
    public Reuslt tree(){
        List<PmsCategory> list=categoryService.tree();
        return new  Reuslt(200,true,"遍历成功",list);
    }

}
